import 'package:bloctest/utils/RouteUtils.dart';
import 'package:bloctest/utils/base/LifeCyclePage.dart';
import 'package:flutter/cupertino.dart';

import 'KnowledgeDetailPresenter.dart';
import 'package:flutter/material.dart';


class KnowledgeDetailPage extends LifeCyclePage {
  const KnowledgeDetailPage({super.key});

  @override
  KnowledgeDetailPageState createState() => KnowledgeDetailPageState();
}

class KnowledgeDetailPageState extends LifeCyclePageState<KnowledgeDetailPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: getContent(),
      appBar: PreferredSize(
        preferredSize: Size.fromHeight(kToolbarHeight),
        child: Container(
          padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
          child: Row(
            children: [
              // 返回按钮
              IconButton(
                icon: Icon(Icons.arrow_back_ios_new, color: Colors.black87),
                onPressed: () {
                  // 处理点击事件
                  RouteUtils.pop(context);
                },
              ),
              // 搜索视图
              Expanded(
                child: getAppBar(),
              ),
            ],
          ),
        )

      ),
    );
  }

  Widget getAppBar() {
    return Row(
      children: [
        TextField(style:TextStyle() ,)
      ],
    );
  }

  Widget getContent() {
    return SafeArea(child: Text("11"));
  }

  @override
  KnowledgeDetailPresent createPresenter() => KnowledgeDetailPresent(this);

  @override
  KnowledgeDetailPresent get presenter =>
      super.presenter as KnowledgeDetailPresent;
}
